import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
      {
        path:'/',
        name:'contents',
        component:()=>import('@/views/Main.vue'),
        redirect: "/contents/xuexiao",
        children:[
          {
            path: "/contents/xuexiao",
            name: "xuexiao",
            component: () => import('@/views/content/xuexiao/xuexiao.vue'),
            redirect: "/contents/xuexiao/yaowen",
            children: [
              {
                path:"/contents/xuexiao/:sub",
                name:'xuexiao-sub',
                component:()=>import('@/views/content/xuexiao/xuexiaoSub.vue')
              }
            ],
          },
          {
            path: "/contents/jiaowu",
            name: "jiaowu",
            component: () => import('@/views/content/jiaowu/jiaowu.vue'),
            redirect: "/contents/jiaowu/tongzhigonggao",
            children: [
              {
                path: "/contents/jiaowu/:sub",
                name: "jiaowu-sub",
                component: () => import('@/views/content/jiaowu/jiaowuSub.vue'),
              }
            ]
          },
          {
            path: "/contents/xueyuan",
            name: "xueyuan",
            component: () => import('@/views/content/xueyuan/xueyuan.vue'),
            children: [
              {
                path: "/contents/xueyuan/:part",
                children: [
                  {
                    path: "/contents/xueyuan/:part/:sub",
                    name: "xueyuan-sub",
                    component: () => import('@/views/content/xueyuan/xueyuanSub.vue'),
                  },
                ],
              },
            ],
          },
          {
            path: "/contents/tuanwei",
            name: "tuanwei",
            component: () => import('@/views/content/tuanwei/tuanwei.vue'),
            redirect: "/contents/tuanwei/tuanqing",
            children: [
              {
                path: "/contents/tuanwei/:sub",
                name: "tuanwei-sub",
                component: () => import('@/views/content/tuanwei/tuanweiSub.vue'),
              },
            ],
          }
        ]
      }
  ],
  linkActiveClass:"router-link-active"
})

export default router
